<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="sb" uri="/struts-bootstrap-tags"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<%-- <%@ include file="/page/company/comHeader.jsp" %> --%>
<!DOCTYPE>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<s:if test="menu.menuId!=null">
<title>企业编辑菜单</title>
</s:if>
<s:else>
<title>企业上传菜单</title>
</s:else>

<link href="<%=basePath %>css/reset.css" rel="stylesheet" type="text/css"/>
<style type="text/css">
	
*{
font-family: '微软雅黑';font-size: 15px;
}
</style>
<script type="text/javascript">
function replaceUpload(obj){
	//alert(111);
	 if(obj.checked==true){
           $("#uploadImage").show();
           
		}else{
			 $("#uploadImage").hide();
	         
			}
}


</script>
<sb:head/>
</head>
<body>
<form action="<%=basePath %>com/menu_saveMenu" method="post" id="save">
<s:hidden name="menu.menuId" value="%{menu.menuId}"></s:hidden>
<s:hidden name="menu.menuImageg" value="%{menu.menuImageg}" id="imageUrl"></s:hidden>
<s:hidden name="menu.menuDate" value="%{menu.menuDate}"></s:hidden>
<s:hidden id="picstyle" value="%{menu.picstyleId}"></s:hidden>
<s:hidden name="comId" value="%{#session.company.comId}"></s:hidden>
<div style="width: 500px;height: 850px;background-color: #f0f8ff ;">
<table>
<tr height="40px;">
<td width="110px">菜单名称<span style="color:red">*</span>：</td>
<td width="270px"><s:textfield name="menu.menuName" value="%{menu.menuName}" placeholder="请输入菜单名称"  theme="simple" style="width:90%;height:100%"></s:textfield></td>
<td width="100px;"></td>
</tr>
<tr height="40px;">
<td width="110px">菜单价格<span style="color:red">*</span>：</td>
<td width="270px"><s:textfield name="menu.menuPrice" value="%{menu.menuPrice}" placeholder="请输入菜单价格"  theme="simple" style="width:90%;height:90%"></s:textfield></td>
<td width="100px;"></td>
</tr>
<tr height="100px;">
<td width="110px">菜单原料<span style="color:red">*</span>：</td>
<td width="270px"><s:textarea  rows="3" name="menu.menuMaterial" value="%{menu.menuMaterial}" placeholder="请输入菜单原料"  theme="simple" style="width:90%;height:90%"></s:textarea><a href="javascript:;" class="tip ib" title='自定义填写内容，如：客户签订合同编号、发票编号等'>tips</a></td>
<td width="100px;"></td>
</tr>
<tr height="100px;">
<td width="110px">菜单做法<span style="color:red">*</span>：</td>
<td width="270px"><s:textarea name="menu.menuPractice" value="%{menu.menuPractice}" placeholder="请输入菜单做法"  theme="simple" style="width:90%;height:90%"></s:textarea><a href="javascript:;" class="tip ib" title='自定义填写内容，如：客户签订合同编号、发票编号等'>tips</a></td>
<td width="100px;"></td>
</tr>
<tr height="80px;">
<td width="110px">图片尺寸<span style="color:red">*</span>：</td>
<td width="170px" colspan="2" style="background-color: #f0e68c">
<s:iterator value="%{picStyles}" id="picStyle" status="pic">
<s:if test="#picStyle.styleValue=='300*300'">
<input type="radio" class="pics" value='<s:property value="#picStyle.styleId"/>' checked="checked" name="menu.picstyleId"/><s:property value="#picStyle.styleValue"/><span style="color:red">(推荐)</span>&nbsp;&nbsp;
</s:if>
<s:else>
<input type="radio" class="pics" value='<s:property value="#picStyle.styleId"/>' name="menu.picstyleId"/><s:property value="#picStyle.styleValue"/>&nbsp;&nbsp; 
</s:else>
<s:if test="#pic.index==3"><br/></s:if>
</s:iterator>
</td>
</tr>
<s:if test="menu.menuId!=null">
<tr height="100px;">
<td width="110px"></td>
<td width="70px"><input type="checkbox" id="repUpload" onclick="replaceUpload(this)"/>重新上传图片</td>
<td width="100px;" align="left"><a href="<%=basePath%>upload/<s:property value="menu.menuImageg"/>"  target="_bank">查看图片</a> </td>
</tr>
<%-- <tr id="upload1" height="40px;">
<td width="110px"></td>
<td width="100px" colspan="2"><input type="reset" value="重置" class="btn btn-inverse" style="width:170px;height: 40px;"/><span style="padding-left:10px;"></span><input type="submit" class="btn btn-success" value="保存" style="width:170px;height: 40px;"/></td>
</tr>
<tr id="upload2" height="750px;" style="display: none">
<td width="110px"></td>
<td width="100px" colspan="2"><input type="reset" value="重置" class="btn btn-inverse" style="width:170px;height: 40px;"/><span style="padding-left:10px;"></span><input type="submit" class="btn btn-success" value="保存" style="width:170px;height: 40px;"/></td>
</tr> --%>
</s:if>
<s:else>
<%-- <tr height="750px;">
<td width="110px"></td>
<td width="100px" colspan="2"><input type="reset" value="重置" class="btn btn-inverse" style="width:170px;height: 40px;"/><span style="padding-left:10px;"></span><input type="submit" class="btn btn-success" value="保存" style="width:170px;height: 40px;"/></td>
</tr> --%>
</s:else>
</table>
</div>
</form>
<s:if test="menu.menuId!=null">
<div id="uploadImage" style="position: absolute;left:120px;top:450px;display: none"><jsp:include page="/page/common/fileUpload.jsp"></jsp:include> </div>
</s:if>
<s:else>
<div style="position: absolute;left:120px;top:380px;"><jsp:include page="/page/common/fileUpload.jsp"></jsp:include> </div>
</s:else>
<%-- <jsp:include page="/page/company/comFooter.jsp"></jsp:include> --%>
</body>
<script type="text/javascript">
var picstyle=$("#picstyle").val();
if(picstyle!=null){
	$(".pics").removeAttr('checked'); 
	$(".pics[value="+picstyle+"]").attr("checked","checked");
}

</script>
</html>